<?
if (!defined ('L_MOD')) {die("<h3>You can`t access this file...</h3>");}

$globalError=0;

if ($_SESSION['auth']!=1)
{
	print '<br><br><center><b><font color="#FF0000">'._ERROR_.'</font> '._ERROREDITAUTH_.'</b></center>';
	$globalError=1;
	echo "<meta http-equiv='refresh' content='2; url=/index.php?nma=".$nma."&fla=index'>";
}else
{
	$globalError=0;
	if (!isset($sid) || !is_numeric($sid) || $sid=='' || $sid<=0)
	{
		print '<br><br><center><b><font color="#FF0000">'._ERROR_.'</font> '._ERROREDITSITE_.'</b></center>';
		$globalError=1;
		echo "<meta http-equiv='refresh' content='2; url=/index.php?nma=".$nma."&fla=index'>";
	}else
	{
		$globalError=0;
	
		$query=mysql_query("SELECT * FROM ${wcpref}".$nma." WHERE mod_id='".$sid."'");
		extract(mysql_fetch_array($query));
		if ($_SESSION['user_id']!=$mod_user_id)
		{
			print '<br><br><center><b><font color="#FF0000">'._ERROR_.'</font> '._ERROREDITUSER_.'</b></center>';
			$globalError=1;
			echo "<meta http-equiv='refresh' content='2; url=/index.php?nma=".$nma."&fla=index'>";
		}else
			$globalError=0;
	}
}



if ($globalError==0)
{
	$query="DELETE FROM ${wcpref}".$nma." WHERE mod_id='".$sid."'";
	if (mysql_query($query))
	{
		print "<center><br><br>"._WAITMESSAGE_."</center>";
		echo "<meta http-equiv='refresh' content='0; url=/index.php?nma=".$nma."&fla=mysites'>";
	}else
	{
		print '<br><br><center><b><font color="#FF0000">'._ERROR_.'</font> '._ERRORADDQUERY_.'</b></center>';
		echo "<meta http-equiv='refresh' content='2; url=/index.php?nma=".$nma."&fla=mysites'>";
	}
}
?>